package cn.nn200433.mqtt.service.impl;

import cn.nn200433.mqtt.config.MqttClientProperties;
import cn.nn200433.mqtt.service.IMqttConnectService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttAsyncClient;

/**
 * 默认mqtt处理程序服务实现
 *
 * @author nn200433
 * @date 2022-06-28 028 10:31:57
 */
@Slf4j
public class DefaultMqttConnectServiceImpl implements IMqttConnectService {
    
    @Override
    public void connectComplete(MqttAsyncClient client, MqttClientProperties mqttConfig, boolean reconnect, String serverURI,
                                String connectMsg) {
        log.debug("--->【MQTT】{}", connectMsg);
    }
    
    @Override
    public void connectionLost(MqttAsyncClient client, MqttClientProperties mqttConfig, Throwable cause, String tryMsg) {
        log.warn("--->【MQTT】连接丢失...{}", tryMsg);
    }
    
}
